#pragma once

namespace ftp
{

class IChannelSync;

class IChannel
{
public:
	virtual ~IChannel() {}

	virtual void asyncWrite(const char* buffer, size_t bufferSize) = 0;
	virtual void asyncRead() = 0; 

	void setSync(IChannelSync* sync)
	{
		m_sync = sync;
	}

protected:
	IChannelSync* m_sync;
};

class IChannelSync
{
public:
	virtual ~IChannelSync() {}

	virtual void onBytesRead(bool ok, const char* bytes, size_t bytesSize) = 0;
	virtual void onBytesWrote(bool ok) = 0;
};

} //ftp
